﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using BUS;
using Entity;

public partial class User_InHoaDon : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Username"] == null)
            Response.Redirect("../Default.aspx");
        if (Session["MaHD"] == null)
            Response.Redirect("XuatHang.aspx");

        String maphieu = (String)Session["MaHD"];

        CrystalReportSource1.ReportDocument.SetDataSource(InHoaDonBUS.HoaDonXH(maphieu));
        CrystalReportSource1.ReportDocument.SetParameterValue("@maphieu", maphieu);

        CrystalReportSource1.DataBind();
        CrystalReportViewer1.ReportSource = CrystalReportSource1;
        
    }
    protected void btnBack_Click(object sender, ImageClickEventArgs e)
    {
        Session["XuatHang"] = null;
        Session["MaHD"] = null;
        Response.Redirect("XuatHang.aspx");
    }
}
